package cn.zjj.pet.controller;

import cn.zjj.basic.anno.PreAuthorize;
import cn.zjj.pet.domain.PetType;
import cn.zjj.pet.service.IPetTypeService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/petType")
@Api(value = "宠物类型的API",description="宠物类型相关的CRUD功能")
public class PetTypeController {

    @Autowired
    private IPetTypeService petTypeService;

    @GetMapping("/typeTree")
    @PreAuthorize(name = "宠物类型树",value = "petType:tree")
    public List<PetType> typeTree(){
        return petTypeService.typeTree();
    }

}
